package com.fulong.common.utils;

import com.fulong.entity.DeviceJobInfoEntity;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.impl.StdSchedulerFactory;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JobList {
    static class JoblistFactory{
        public static Map<String , DeviceJobInfoEntity> jobmap = new HashMap<>();
        public static Scheduler scheduler;
        static {
            try {
                scheduler = StdSchedulerFactory.getDefaultScheduler();
                scheduler.start();
            } catch (SchedulerException e) {
                e.printStackTrace();
            }
        }
    }
    private JobList(){
        super();
    }
    public static Map<String , DeviceJobInfoEntity> getJobmap(){
        return JoblistFactory.jobmap;
    }
    public static Scheduler getScheduler(){
        return JoblistFactory.scheduler;
    }
}
